#!/bin/bash -l

# Note: A line of the form "#$ qsub_option" is interpreted
# by qsub as if "qsub_option" was passed to qsub on
# the commandline. A line of the form "# COMMENT" is
# interpreted as a comment.
# Set the runtime limit to 2 hours
#$ -l h_rt=48:00:00
# Set memory resources
#$-l mem_per_core=16G
# Set to omp parallel environment with 16 processors(or 28)
#$ -pe omp 16
# Merge output files to reduce clutter
#$ -j y
# Name the standard output and error file
#$ -o log
# Name your job
#$ -N Est_11378_time
# Email me when finish
# -m ea
# Specify the range of tasks $SGE_TASK_ID
#$ -t 78-113

echo "=========================================================="
echo "Starting on : $(date)"
echo "Running on node : $(hostname)"
echo "Current directory : $(pwd)"
echo "Current job ID : $JOB_ID"
echo "Current job name : $JOB_NAME"
echo "Task index number : $SGE_TASK_ID"
echo "=========================================================="
# Run the job. Here, example.R is the name of the .R file. Input: counter.method, rho.spec, sample.id
module load R
echo "Counterfactual Method = $1, Rho's Specification = $2, Sample = $SGE_TASK_ID"
Rscript DRS_Emp_Est.R $1 $2 $SGE_TASK_ID
echo "=========================================================="
echo "Finished on : $(date)"
echo "=========================================================="
